//
//  WordContentCell.m
//  Learn
//
//  Created by chijianguo on 2024/4/10.
//  Copyright © 2024 迟建国. All rights reserved.
//

#import "WordContentCell.h"
#import "WordReadResultView.h"
#import "TextBookUnitSourceListModel.h"

@interface WordContentCell ()
@property (nonatomic, strong) WordReadResultView *scoreView;


@end

@implementation WordContentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle=UITableViewCellSelectionStyleNone;
    self.scoreView = [[WordReadResultView alloc] init];
    [self addSubview:self.scoreView];
    [self.scoreView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-20);
        make.size.mas_equalTo(CGSizeMake(120, 120));
        make.bottom.equalTo(self).offset(-20);
    }];
//    self.scoreView.hidden = YES;
}

- (void)setModel:(TextBookUnitWordModel *)model {
    _model = model;
    self.scoreView.hidden = !model.isRead;
    self.scoreView.scoreLB.text = [NSString stringWithFormat:@"%.1f 分",model.totalScore];
    self.scoreView.wanchengLB.text = [NSString stringWithFormat:@"完整度  %.1f",model.completionDegree];
    self.scoreView.liuliLB.text = [NSString stringWithFormat:@"流利度  %.1f",model.fluentDegree];
    self.scoreView.zhunqueLB.text = [NSString stringWithFormat:@"准确度  %.1f",model.accurateDegree];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
